import request from '@/utils/request'

const baseUrl = '/admin/api/v1/permission'

/**
 * 查询所有权限列表
 */
export const getPermissionList = () => {
  return request.get(`${baseUrl}/list`)
}

/**
 * 根据ID查询权限详情
 */
export const getPermissionById = (id) => {
  return request.get(`${baseUrl}/${id}`)
}

/**
 * 创建权限
 */
export const createPermission = (data) => {
  return request.post(baseUrl, data)
}

/**
 * 更新权限
 */
export const updatePermission = (id, data) => {
  return request.put(`${baseUrl}/${id}`, data)
}

/**
 * 删除权限
 */
export const deletePermission = (id) => {
  return request.delete(`${baseUrl}/${id}`)
}

